import React from 'react';

var Content = React.createClass({

    render: function(){
        return(
            <div>
                <input type="text"
                       value={this.props.myDataProp}
                       onChange={this.props.updateStateProp}
                       />
            </div>
        )
    }
})

var HelloMessage = React.createClass({
    getInitialState: function () {
        return {
            value: 'Hello World111'
        }
    },
    handleChange: function (event) {
        console.log(event);
        this.setState({
            value: event.target.value
        })
    },
    render: function(){
        var value = this.state.value;
        return (
            <div>
                <Content myDataProp={value}
                         updateStateProp={this.handleChange}>

                </Content>
            </div>
        )
    }
})

export default HelloMessage;